﻿@using Website.CRUDServices
@using Location = Website.Models.Domain.Location
@{
    this.ViewBag.Title = "Søgning - Klynger";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    List<Project> projects = this.ViewData["Projects"] as List<Project> ?? new List<Project>();
    List<Location> locations = this.ViewData["Locations"] as List<Location> ?? new List<Location>();
    List<ClusterMethodType> clusterMethodTypes = this.ViewData["ClusterMethodTypes"] as List<ClusterMethodType> ?? new List<ClusterMethodType>();
    List<ClusterStatusType> clusterStatusTypes = this.ViewData["ClusterStatusTypes"] as List<ClusterStatusType> ?? new List<ClusterStatusType>();
}

<h2>@ViewBag.Title</h2>

<script>
    $(function () {
        $('#Profiles').multiSelect();
        $('#MethodTypes').multiSelect();
        $('#StatusTypes').multiSelect();
    });
</script>

@using (this.Html.BeginForm("ClusterSearchResult", "Reports"))
{
    @* Tilføjer søge-partial *@
    @Html.Partial("~/Views/Reports/_SearchDefaultFields.cshtml", projects)
    
    <div class="formBullet">Lokation:</div>
    <div class="formEntry">
        <select name="Location" id="Location">
            <option value="@Guid.Empty.ToString()" selected="selected"></option>
            @foreach (Location loc in locations)
            {
                <option value="@loc.ID">@loc.Name</option>
            }
        </select>
    </div>
    
    
    <div class="formBullet">Metoder og tematiserede rapporter:</div>
    <div class="formEntry">
        <select name="MethodTypes" id="MethodTypes" multiple="multiple">
            @foreach (ClusterMethodType cmt in clusterMethodTypes)
            {
                <option value="@cmt.ID">@cmt.Name</option>
            }
        </select>
    </div>
    
    
    <div class="formBullet">Status typer:</div>
    <div class="formEntry">
        <select name="StatusTypes" id="StatusTypes" multiple="multiple">
            @foreach (ClusterStatusType cst in clusterStatusTypes)
            {
                <option value="@cst.ID">@cst.Name</option>
            }
        </select>
    </div>
    
    <div class="buttonHolder">
        <input type="submit" value="Søg" /></div>
}